cmake_minimum_required(VERSION 3.19)
project(LVGL_GuiGuider_V8)
message("-- " ${PROJECT_NAME} " " ${CMAKE_CXX_COMPILER})
message("-- Modified by Coolouba")
add_definitions(-DLV_CONF_INCLUDE_SIMPLE)
set(CMAKE_CXX_STANDARD 20) #1
set(CMAKE_CXX_FLAGS "-Wno-error=deprecated-declarations -Wno-deprecated-declarations ")

macro(FIND_INCLUDE_DIR result curdir)
    file(GLOB_RECURSE children "${curdir}/*.hpp" "${curdir}/*.h" )
    #message(STATUS "children= ${children}")
    set(dirlist "")
    foreach(child ${children})
        string(REGEX REPLACE "(.*)/.*" "\\1" LIB_NAME ${child})
        if(IS_DIRECTORY ${LIB_NAME})
            LIST(APPEND dirlist ${LIB_NAME})
        endif()
    endforeach()
    set(${result} ${dirlist})
endmacro()

FIND_INCLUDE_DIR(INCLUDE_DIR_LIST ${PROJECT_SOURCE_DIR}/custom)
include_directories(${INCLUDE_DIR_LIST})
FIND_INCLUDE_DIR(INCLUDE_DIR_LIST ${PROJECT_SOURCE_DIR}/generated)
include_directories(${INCLUDE_DIR_LIST})
FIND_INCLUDE_DIR(INCLUDE_DIR_LIST ${PROJECT_SOURCE_DIR}/lv_drivers)
include_directories(${INCLUDE_DIR_LIST})
FIND_INCLUDE_DIR(INCLUDE_DIR_LIST ${PROJECT_SOURCE_DIR}/lvgl)
include_directories(${INCLUDE_DIR_LIST})
FIND_INCLUDE_DIR(INCLUDE_DIR_LIST ${PROJECT_SOURCE_DIR}/lvgl-simulator)
include_directories(${INCLUDE_DIR_LIST})
FIND_INCLUDE_DIR(INCLUDE_DIR_LIST ${PROJECT_SOURCE_DIR}/main)
include_directories(${INCLUDE_DIR_LIST})

file(GLOB_RECURSE HEADERS lv_drivers/sdl/*.h lvgl/*.h lvgl/src/*.h custom/*.h generated/*.h generated/images/*.h generated/guider_fonts/*.h generated/guider_customer_fonts/*.h lvgl-simulator/lv_conf.h lvgl-simulator/lv_drv_conf.h lvgl.hi= ko)
file(GLOB_RECURSE SOURCES lv_drivers/sdl/*.c lvgl/*.c lvgl/src/*.c custom/*.c generated/*.c generated/images/*.c generated/guider_fonts/*.c generated/guider_customer_fonts/*.c main/*.c)

include_directories(.  ./lvgl sdl2/include)
link_directories(sdl2/lib)
#message(${HEADERS})
#message(${SOURCES})
add_executable(LVGL_GuiGuider  ${HEADERS} ${SOURCES})

target_link_libraries(LVGL_GuiGuider libSDL2)
